//群组管理JS
//[2015.04.16 Yu]


function createGroup()
{
	var name = $("#groupName").val();
	var intro = $("#groupIntro").val();
	if((name.length == 0) || (intro.length == 0))
	{
		alert("群组名/群组简介不能为空！");
		return;
	}
	if(getBytesCount(name) > 24)
	{
		alert("群组名字不超过8字符！");
		return;
	}
	if(getBytesCount(intro) > 256)
	{
		alert("简介不超过60字符！");
		return;
	}
	
	var httpRequest = createXmlHttpRequest();
	var regionID = getCookie("region_id");
	
	var keyList = ['&mod=', '&ac=', '&RegionID=', '&Name=', '&Introduction='];
	var valueList = ['region', 'createGroupNew', regionID,    name,       intro];				
	makeRequest(keyList, valueList, httpRequest, function(){
		if(httpRequest.readyState == 4 && httpRequest.status == 200)
		{
			var b = httpRequest.responseText;
			document.write(b);
			var res = eval('(' + b + ')');
			if(res.Result == 0)
			{
				alert("群组创建成功！");
				history.go(-1);
			}
			else
			{
				errorParse(res.Result);
			}
		}
	});
	
	
}


